package chapter03;
public class Test05_polymorphic {
    public static void main(String[] args) {
        Animal3 a1 = new Cat();
        Animal3 a2 = new Dog3();
        a1.shout();
        a2.shout();
    }
}
abstract class Animal3{
    abstract void shout();
}
class Cat extends Animal3{
    public void shout(){
        System.out.println("喵喵");
    }
}
class Dog3 extends Animal3{
    @Override
    public void shout() {
        System.out.println("汪汪");
    }
}
